package sg.edu.nus.iss.phoenix.presenterproducer.delegate;

import java.util.ArrayList;

import sg.edu.nus.iss.phoenix.presenterproducer.service.ReviewSelectPresenterProducerService;
import sg.edu.nus.iss.phoenix.authenticate.entity.User;
import sg.edu.nus.iss.phoenix.authenticate.entity.Role;
import sg.edu.nus.iss.phoenix.presenterproducer.entity.PresenterProducerSearchObject;

public class ReviewSelectPresenterProducerDelegate {

	public ReviewSelectPresenterProducerDelegate(){
		super();
	}
	
	public ArrayList<User> searchPresenter(PresenterProducerSearchObject ppsearchobject){
		User user = new User();
		Role role = new Role();
		
		user.setName(ppsearchobject.getname());
		role.setRoleId(ppsearchobject.getrollid());
		System.out.println(" ReviewSelectPresenterProducerDelegate :: searchPresenter :: Before Service");
		ReviewSelectPresenterProducerService reviewselectPPService = new ReviewSelectPresenterProducerService();
		return reviewselectPPService.searchPresenter(user,role);
	}
	
	public ArrayList<User> searchAllPresenter(PresenterProducerSearchObject ppsearchobject){
		Role role = new Role();
		role.setRoleId(ppsearchobject.getrollid());
		
		ReviewSelectPresenterProducerService reviewselectPPService = new ReviewSelectPresenterProducerService();
		return reviewselectPPService.searchAllPresenter(role);
	}
	
	public ArrayList<User> searchProducer(PresenterProducerSearchObject ppsearchobject){
		User user = new User();
		Role role = new Role();
		
		user.setName(ppsearchobject.getname());
		role.setRoleId(ppsearchobject.getrollid());
		
		ReviewSelectPresenterProducerService reviewselectPPService = new ReviewSelectPresenterProducerService();
		return reviewselectPPService.searchProducer(user,role);
	}
	
	public ArrayList<User> searchAllProducer(PresenterProducerSearchObject ppsearchobject){
		Role role = new Role();
		role.setRoleId(ppsearchobject.getrollid());
		
		ReviewSelectPresenterProducerService reviewselectPPService = new ReviewSelectPresenterProducerService();
		return reviewselectPPService.searchAllProducer(role);
	}
	
}
